//
//  OAApproveRejectedVC.m
//  OA项目
//
//  Created by innofive on 2018/4/16.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "OAApproveRejectedVC.h"

@interface OAApproveRejectedVC ()

@end

@implementation OAApproveRejectedVC

+(OAApproveRejectedVC *)rejectedVCForType:(openVCType)type
{
    OAApproveRejectedVC *vc = [[self alloc]init];
    vc.type = type;
    return vc;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)onLoadViewByWillAppear:(UIView *)view
{
    UIButton *btn = ({
        UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
        [l AddTarget:self Action:@selector(onClickBtn:)];
        l.backgroundColor = [UIColor clearColor];
        l.tag = 10;
        [view addV:l];
        l;
    });
 
    if (self.type==openVCTypeTwo) {
        
        UIView *bgView = ({
            UIView *l = [UIView new];
            l.backgroundColor = [UIColor whiteColor];
            [view addV:l];
            l;
        });
        
        UILabel *label = ({
            UILabel *l = [UILabel new];
            l.textAlignment = NSTextAlignmentCenter;
            l.text = @"驳回理由";
            l.font = kSysFont(kFitW(13));
            l.textColor = [UIColor blackColor];
            l.hasBottomLine= YES;
            [bgView addV:l];
            l;
        });
        
        HLTextView *textV = ({
            HLTextView *l = [HLTextView new];
            l.placeholder = @"请编写理由";
            [bgView addV:l];
            l;
        });
        
        
        
        UIButton *btn1 = ({
            UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
            [l AddTarget:self Action:@selector(onClickBtn:)];
            [l setNormalTitle:@"确定"];
            l.titleLabel.font = kSysFont(kFitW(12));
            l.backgroundColor = hexCOLOR(@"D2A452");
            l.tag = 20;
            [bgView addV:l];
            l;
        });
        [self onMainQueueAddSub:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
            
            btn.frame = CGRectMake(0, 0, size.width, size.height);
            
            bgView.size = CGSizeMake(size.width-kFitW(80),kFitH(275));
            bgView.centerX = size.width/2;
            bgView.centerY = size.height/2;
            
            
            label.frame = CGRectMake(0, 0, bgView.size.width, kFitH(50));
            
            textV.frame = CGRectMake(0,label.height,bgView.size.width,kFitH(275)-kFitH(90));
            
            btn1.size = CGSizeMake(bgView.size.width-kFitW(50), kFitH(40));
            btn1.left = kFitW(25);
            btn1.bottom =bgView.size.height-kFitH(25);
            
        }];
        
    }else
    {
        UIView *bgView = ({
            UIView *l = [UIView new];
            l.backgroundColor = [UIColor whiteColor];
            l.cornerRadius = 3;
            l.masksToBounds = YES;
            [view addV:l];
            l;
        });
        
        UILabel *label = ({
            UILabel *l = [UILabel new];
            l.textAlignment = NSTextAlignmentCenter;
            l.text = @"是否确认驳回申请";
            l.font = kSysFont(kFitW(13));
            l.textColor = [UIColor blackColor];
            l.hasBottomLine= YES;
            [bgView addV:l];
            l;
        });
        
      
        UIButton *btn1 = ({
            UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
            [l AddTarget:self Action:@selector(onClickBtn:)];
            [l setNormalTitle:@"否"];
            l.titleLabel.font = kSysFont(kFitW(12));
            [l setNormalTitleColor:[UIColor blackColor]];
            //l.backgroundColor = [UIColor yellowColor];
            l.cornerRadius =kFitH(30)/2;
            l.borderWidth = 0.5;
            l.borderColor = hexCOLOR(@"DEDFE0");
            l.masksToBounds = YES;
            l.tag = 20;
            [bgView addV:l];
            l;
        });
        
        UIButton *btn2 = ({
            UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
            [l AddTarget:self Action:@selector(onClickBtn:)];
//            l.backgroundColor = [UIColor redColor];x
            [l setNormalTitle:@"是"];
            [l setNormalTitleColor:hexCOLOR(@"A6913A")];
            l.titleLabel.font = kSysFont(kFitW(12));
            l.borderWidth = 0.5;
            l.cornerRadius =kFitH(30)/2;
            l.borderColor = hexCOLOR(@"A6913A");
            l.masksToBounds = YES;
            l.tag = 30;
            [bgView addV:l];
            l;
        });
        
        [self onMainQueueAddSub:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
            
            btn.frame = CGRectMake(0, 0, size.width, size.height);
            
            bgView.size = CGSizeMake(size.width-kFitW(100),kFitH(290)/2);
            bgView.centerX = size.width/2;
            bgView.centerY = size.height/2;
            
            label.frame = CGRectMake(0, 0, bgView.size.width, kFitH(70));
          
            btn1.size = CGSizeMake(kFitW(70), kFitH(30));
            btn1.left = kFitW(35);
            btn1.centerY =kFitH(70)+kFitH(75)/2;
            
            btn2.size = CGSizeMake(kFitW(70), kFitH(30));
            btn2.right =bgView.size.width - kFitW(35);
            btn2.centerY =kFitH(70)+kFitH(75)/2;
            
        }];
    }
        
    
}

-(void)onClickBtn:(UIButton *)button
{
    [super onDismissReturn];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
